﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.Data
{
    /// <summary>
    /// 错误信息
    /// </summary>
    public class CheckResultMessage
    {

        #region 构造函数

        public CheckResultMessage(CheckErrorType checkErrorType, PackageType packageType, ErrorType errorType)
        {

            _checkErrorType = checkErrorType;

             _packageType = packageType;

             _errorType = errorType;


        
        }

        #endregion

        #region 字段属性

        CheckErrorType _checkErrorType = CheckErrorType.Warning;


        PackageType _packageType = PackageType.BARRIER_mf;


        ErrorType _errorType = ErrorType.AllZero;



        string _messageStr = "No Warning  No Error ";//详细描述

        public string MessageStr
        {
            get { return _messageStr; }
           
        }


        #endregion

        #region 共有方法

        public string GetMessage()
        {
            return _messageStr;
        }

        public void SetMessage(string message)
        {
            //格式：CheckErrorType .Warning.ToString ()+"   "+PackageType .BASIC_mf.ToString ()+"  "+ErrorType .AllZero .ToString ()+"  "+具体描述
            _messageStr = message;
        }

        public void ClearMessage()
        {
            _messageStr = "";
        }
        public void UpdateCheckErrorType(CheckErrorType checkErrorType)
        {
            _checkErrorType = checkErrorType;

        }
        public void UpdatePackageType(PackageType packageType)
        {
             _packageType=packageType;
        }
        public void UpdateErrorType(ErrorType errorType)
        {
             _errorType = errorType;
        }




        #endregion

        #region 内部方法

       
        private void WriteMessage()
        {
            _messageStr = _checkErrorType.ToString() + "   " + _packageType.ToString() + " : " + _errorType.ToString();
        }



        #endregion


    }
}
